home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / BITMAPGA.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  78 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1993, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.3  $
  6. //
  7. // Definition of class TBitmapGadget
  8. //----------------------------------------------------------------------------
  9. #if !defined(OWL_BITMAPGA_H)
  10. #define OWL_BITMAPGA_H
  11.  
  12. #if !defined(OWL_GADGET_H)
  13. # include <owl/gadget.h>
  14. #endif
  15.  
  16. #if defined(BI_NAMESPACE)
  17. namespace OWL {
  18. #endif
  19.  
  20. // Generic definitions/compiler options (eg. alignment) preceeding the 
  21. // definition of classes
  22. #include <services/preclass.h>
  23.  
  24. class _OWLCLASS TCelArray;
  25.  
  26. //
  27. // class TBitmapGadget
  28. // ~~~~~ ~~~~~~~~~~~~~
  29. // Simple gadget that can display an array of bitmap images, one at a time.
  30. //
  31. class _OWLCLASS TBitmapGadget : public TGadget {
  32.   public:
  33.     TBitmapGadget(TResId imageResIdOrIndex,
  34.                   int    id,
  35.                   TBorderStyle borderStyle,
  36.                   int    numImages,
  37.                   int    startImage = 0,
  38.                   bool   sharedCels = false);
  39.    ~TBitmapGadget();
  40.  
  41.     int  SelectImage(int imageNum, bool immediate);
  42.     int  GetImage() const;
  43.  
  44.     void SysColorChange();
  45.  
  46.   protected:
  47.     void Paint(TDC& dc);
  48.  
  49.     void SetBounds(const TRect& boundRect);
  50.     void GetDesiredSize(TSize& size);
  51.  
  52.   private:
  53.     TResId     ResId;
  54.     TCelArray* ImageArray;
  55.     int        ImageIndex;
  56.     int        CurrentImage;
  57.     int        NumImages;
  58.     TPoint     BitmapOrigin;
  59. };
  60.  
  61. // Generic definitions/compiler options (eg. alignment) following the 
  62. // definition of classes
  63. #include <services/posclass.h>
  64.  
  65. #if defined(BI_NAMESPACE)
  66. } // namespace OWL
  67. #endif
  68.  
  69. //
  70. // Inline implementations
  71. //
  72. //
  73. inline int TBitmapGadget::GetImage() const {
  74.   return CurrentImage;
  75. }
  76.  
  77. #endif  // OWL_BITMAPGA_H
  78.